import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';

class DAppTagSkeleton extends StatefulWidget {
  bool showAtBottom = false;

  DAppTagSkeleton({
    super.key,
  });

  @override
  _DAppTagSkeletonItemState createState() => _DAppTagSkeletonItemState();
}

class _DAppTagSkeletonItemState extends State<DAppTagSkeleton> {
  double domWidth = 30;

  @override
  void initState() {
    super.initState();
    double randomInt = Random().nextDouble();
    setState(() {
      domWidth = 30 + (81 - 30) * randomInt;
    });
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      margin: EdgeInsets.only(right: 10.w),
      child: Shimmer.fromColors(
          baseColor: Color.fromRGBO(246, 246, 246, 1),
          highlightColor: Colors.grey.shade300,
          child: Container(
            height: 30.w,
            width: domWidth,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(4.w),
              color: Colors.grey,
            ),
          )),
    );
  }
}
